interface DateRollType {
  toggleShow(): void;
}

const useSelWk = defineStore("selWk", () => {
  const curWk = ref<string | number>(1);
  const wkRef = ref<DateRollType>();
  function initWeek(newWeek: string | number = 1) {
    curWk.value = newWeek;
  }
  const toggleWeek = () => {
    // console.log(curWk.value);
    if (wkRef.value) {
      wkRef.value.toggleShow();
    } else {
      console.warn(`wkRef is not initialized or is null.`);
    }
  };

  return {
    toggleWeek,
    initWeek,
    wkRef,
    curWk
  };
});
export const useSelWkRefs = () => storeToRefs(useSelWk());
export default useSelWk;
